//
//  ViewController.m
//  KVO
//
//  Created by fly on 15/12/25.
//  Copyright © 2015年 mac. All rights reserved.
//

#import "ViewController.h"
#import "StockData.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    StockData *stockForKVO = [[StockData alloc] init];
    [stockForKVO setValue:@"name" forKey:@"stockName"];
    [stockForKVO setValue:@"10" forKey:@"price"];
    
    [stockForKVO addObserver:self forKeyPath:@"price" options:NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld context:nil];

    
    
    
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
